package com.seeyon.apps.kk.manager;

import java.util.List;
import java.util.Map;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.poi.ss.formula.functions.T;

/**
 * 批处理角色权限
 * 
 * @author seeyon
 *
 */
public class BatchProcessingManagerImpl extends BaseManager {

	private static final Log log = LogFactory.getLog(BatchProcessingManagerImpl.class);

	private FreemarkFlowManager freemarkFlowManager;

	public FreemarkFlowManager getFreemarkFlowManager() {
		return freemarkFlowManager;
	}

	public void setFreemarkFlowManager(FreemarkFlowManager freemarkFlowManager) {
		this.freemarkFlowManager = freemarkFlowManager;
	}

	/**
	 * 根据当前登录人Id 检查批处理角色是否存在
	 * @param map
	 * @return
	 */
	public boolean checkBatchProcessingRoleByMemberId(Map<String, Object> map) {
		String sql = this.freemarkFlowManager.fltTemplateIntoString("sql/role/SELECT_BATCH_ROLESQL.ftl", map);
		List<Map<String, Object>> result = this.jdbcTemplate.queryForList(sql);
		if (result.isEmpty())
			return false;
		return true;
	}
}
